home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume13 / xfig2.9 / patch10.01 next >
Encoding:
Internet Message Format  |  1991-07-05  |  54.8 KB

  1. Path: uunet!olivea!oliveb!veritas!amdcad!sun!exodus!bea.lbl.gov
  2. From: envbvs@bea.lbl.gov (Brian V. Smith)
  3. Newsgroups: comp.sources.x
  4. Subject: v13i068: xfig2, Patch10, Part01/04
  5. Message-ID: <16331@exodus.Eng.Sun.COM>
  6. Date: 6 Jul 91 06:59:07 GMT
  7. References: <csx-13i068-xfig2.9@uunet.UU.NET>
  8. Sender: news@exodus.Eng.Sun.COM
  9. Lines: 1827
  10. Approved: argv@sun.com
  11.  
  12. Submitted-by: envbvs@bea.lbl.gov (Brian V. Smith)
  13. Posting-number: Volume 13, Issue 68
  14. Archive-name: xfig2.9/patch10.01
  15. Patch-To: xfig2.9: Volume 8, Issue 10-30
  16. Patch-To: xfig2.9: Volume 10, Issue 26-31
  17.  
  18. Patchlevel 10
  19. Changes from patchlevel 9:
  20.  
  21. o zooming and panning is now possible for all objects except texts.
  22.     Use new buttons, arrow keys for panning. See the man page.
  23.     From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
  24. o selecting one of several overlapping objects is implemented for
  25.     most functions.
  26.     Hold down Shift key while clicking on object to cycle through
  27.     candidate objects, release shift key for selection. See man page.
  28.     From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
  29. o dash length and dot gap width can be modified using the Change menu
  30.     From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
  31. o dash length scaled to line width and zoom factor
  32.     From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
  33. o multiple Grid Sizes
  34.     Two grids are available in the -metric mode
  35.     From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
  36. o open polygons and splines can be filled
  37.     From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
  38. o new resource 'Startfontsize' and command line option -startfontsize
  39.     From Georg Sigl (ges@regent.e-technik.tu-muenchen.de)
  40. o point markers displayed with text objects
  41.     From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
  42. o grid and ruler bitmaps are created dynamically
  43.     This was neccessary for the zoom and pan commands
  44.     From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
  45. o changing text by clicking on it has to be finished with the left
  46.     button. Finishing with the middle button is no longer possible
  47.     (this is rather a workaround for the bug that gave interesting 
  48.     effects)
  49.     From Henning Spruth (hns@regent.e-technik.tu-muenchen.de)
  50. o if a point is to be deleted from a line, at least 2 points must remain
  51.     From Dieter Pellkofer (dip@regent.e-technik.tu-muenchen.de)
  52. o fixed bug where finishing text with middle button, saving figure
  53.     and trying to quit made xfig claim the figure hadn't been saved
  54. o fixed bug where line of zero length with an arrow head would cause f2ps 
  55.     to divide by zero
  56. o there is a bug in OpenWindows which causes xfig to crash when trying to 
  57.     create the pixmaps from one-plane bitmaps for the button icons.  According
  58.     to the Intrinsics manual, the XtNbitmap resource in a widget will auto-
  59.     matically be converted to the proper screen depth, but OpenWindows seems
  60.     not to do this.  Add the define "-DOPENWIN" to the "DEFINES" line
  61.     in the Imakefile if you are running OpenWindows.
  62. o depth of objects is now honored - set object depth with popup change window
  63.     From Mike Lutz <mjl@cs.rit.edu>
  64. o bug fixed where "create object -> read file -> undo" would delete objects
  65.     Tom Tkacik (tkacik@hobbes.cs.gmr.com)
  66. o creation of text is now undoable
  67. o text inside compound is erased properly when compound is moved/deleted etc
  68. o f2ps now uses the -s (font size) option when objects are defined
  69.     with default font size (-1)
  70.     From Ian Dall <idall@augean.ua.oz.au>
  71. o font spacing button value no longer crashes xfig on MIPS type machine
  72. o having spline where two or more points are coincident no longer
  73.     gives DOMAIN error or crashes xfig
  74.     From Mike Lawley <lawley@muse.cs.mu.oz.au>
  75. o attempting to draw arc with two or more coincident points no longer 
  76.     crashes xfig
  77. o definition of errno, sys_nerr and sys_errlist moved to fig.h
  78.     From Casey Leedem <casey@gauss.llnl.gov>
  79. o removed startup message printing to stdout
  80.  
  81. ---------------------------------------------------------------------
  82. --- Part 1 of 4 follows.
  83. ---
  84. --- After unpacking all four parts by following the instructions in
  85. ---       each file, for each resulting file type 'patch -p < patch10.x',
  86. ---      where 'x' is the number of the patch file (1 through 4).
  87. ---------------------------------------------------------------------
  88.  
  89. #! /bin/sh
  90. # This is a shell archive.  Remove anything before this line, then unpack
  91. # it by saving it into a file and typing "sh file".  To overwrite existing
  92. # files, type "sh file -c".  You can also feed this as standard input via
  93. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  94. # will see the following message at the end:
  95. #        "End of archive 1 (of 4)."
  96. # Contents:  patch10.2
  97. # Wrapped by envbvs@bea.lbl.gov.lbl.gov on Fri Jun 14 14:37:00 1991
  98. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  99. if test -f 'patch10.2' -a "${1}" != "-c" ; then 
  100.   echo shar: Will not clobber existing file \"'patch10.2'\"
  101. else
  102. echo shar: Extracting \"'patch10.2'\" \(48592 characters\)
  103. sed "s/^X//" >'patch10.2' <<'END_OF_FILE'
  104. X*** @xfig.pl9/deletept.c    Tue May  1 16:33:49 1990
  105. X--- ./deletept.c    Mon Jun  3 11:13:28 1991
  106. X***************
  107. X*** 13,19 ****
  108. X  #include "object.h"
  109. X  #include "paintop.h"
  110. X  
  111. X- #define            TOLERANCE    3
  112. X  
  113. X  extern            (*canvas_kbd_proc)();
  114. X  extern            (*canvas_locmove_proc)();
  115. X--- 13,18 ----
  116. X***************
  117. X*** 34,46 ****
  118. X  extern F_line        *line;
  119. X  extern F_spline        *spline;
  120. X  
  121. X! extern int        init_delete_point();
  122. X  
  123. X  delete_point_selected()
  124. X  {
  125. X      canvas_kbd_proc = null_proc;
  126. X      canvas_locmove_proc = null_proc;
  127. X!     canvas_leftbut_proc = init_delete_point;
  128. X      canvas_middlebut_proc = null_proc;
  129. X      canvas_rightbut_proc = set_popupmenu;
  130. X      set_cursor(&pick9_cursor);
  131. X--- 33,47 ----
  132. X  extern F_line        *line;
  133. X  extern F_spline        *spline;
  134. X  
  135. X! extern    point_search();
  136. X! int        init_delete_point();
  137. X  
  138. X  delete_point_selected()
  139. X  {
  140. X      canvas_kbd_proc = null_proc;
  141. X      canvas_locmove_proc = null_proc;
  142. X!     init_point_search(init_delete_point);
  143. X!     canvas_leftbut_proc = point_search;
  144. X      canvas_middlebut_proc = null_proc;
  145. X      canvas_rightbut_proc = set_popupmenu;
  146. X      set_cursor(&pick9_cursor);
  147. X***************
  148. X*** 47,67 ****
  149. X      reset_action_on();
  150. X      }
  151. X  
  152. X! init_delete_point(x, y)
  153. X! int     x, y;
  154. X  {
  155. X      F_spline    *spline;
  156. X      F_line        *line;
  157. X-     F_point        *p, *q;
  158. X      int        n;
  159. X  
  160. X      /*
  161. X!     If the attemp to delete point fails, we wouldn't want any important
  162. X!     variables (left_point, right_point and delted_point) to change. 
  163. X!     So we used p and q in the search.
  164. X      */
  165. X  
  166. X!     if ((line = line_point_search(x, y, TOLERANCE, &p, &q)) != NULL) {
  167. X          if (line->type == T_BOX || line->type == T_ARC_BOX) {
  168. X          put_msg("Deleting box corners is not allowed");
  169. X          return;
  170. X--- 48,71 ----
  171. X      reset_action_on();
  172. X      }
  173. X  
  174. X! init_delete_point(obj, type, x, y, p, q)
  175. X! char    *obj;
  176. X! int    type, x, y;
  177. X! F_point    *p,*q;
  178. X  {
  179. X      F_spline    *spline;
  180. X      F_line        *line;
  181. X      int        n;
  182. X  
  183. X      /*
  184. X!     If the attemp to delete point fails, we wouldn't want any 
  185. X!     important variables (left_point, right_point and delted_point) 
  186. X!     to change. So we used p and q in the search.
  187. X      */
  188. X  
  189. X!         switch (type)
  190. X!     { case O_POLYLINE:
  191. X!         line= (F_line *) obj;
  192. X          if (line->type == T_BOX || line->type == T_ARC_BOX) {
  193. X          put_msg("Deleting box corners is not allowed");
  194. X          return;
  195. X***************
  196. X*** 73,79 ****
  197. X              return;
  198. X              }
  199. X          }
  200. X!         else if (n <= 1) {
  201. X          put_msg("A line cannot have less than 2 points");
  202. X          return;
  203. X          }
  204. X--- 77,83 ----
  205. X              return;
  206. X              }
  207. X          }
  208. X!         else if (n <= 2) {  /* changed this from 2 to 1 - hns */
  209. X          put_msg("A line cannot have less than 2 points");
  210. X          return;
  211. X          }
  212. X***************
  213. X*** 84,91 ****
  214. X          linepoint_deleting(line);
  215. X          set_action_object(F_DELETE_POINT, O_POLYLINE);
  216. X          set_latestline(line);
  217. X!         }
  218. X!     else if ((spline=spline_point_search(x, y, TOLERANCE, &p, &q)) != NULL){
  219. X          n = num_points(spline->points);
  220. X          if (closed_spline(spline)) {
  221. X          if (n <= 4) {
  222. X--- 88,97 ----
  223. X          linepoint_deleting(line);
  224. X          set_action_object(F_DELETE_POINT, O_POLYLINE);
  225. X          set_latestline(line);
  226. X!         break;
  227. X!       
  228. X!     case O_SPLINE:
  229. X!         spline= (F_spline *) obj;
  230. X          n = num_points(spline->points);
  231. X          if (closed_spline(spline)) {
  232. X          if (n <= 4) {
  233. X***************
  234. X*** 110,117 ****
  235. X          splinepoint_deleting(spline);
  236. X          set_action_object(F_DELETE_POINT, O_SPLINE);
  237. X          set_latestspline(spline);
  238. X!         }
  239. X      }
  240. X  
  241. X  /**************************  spline  *******************************/
  242. X  
  243. X--- 116,124 ----
  244. X          splinepoint_deleting(spline);
  245. X          set_action_object(F_DELETE_POINT, O_SPLINE);
  246. X          set_latestspline(spline);
  247. X!         break;
  248. X      }
  249. X+       }
  250. X  
  251. X  /**************************  spline  *******************************/
  252. X  
  253. X*** @xfig.pl9/dir.c    Fri Apr 27 10:29:30 1990
  254. X--- ./dir.c    Mon Jun  3 13:25:16 1991
  255. X***************
  256. X*** 9,17 ****
  257. X  */
  258. X  #include "fig.h"
  259. X  
  260. X- extern char        *sys_errlist[];
  261. X- extern int        sys_nerr, errno;
  262. X- 
  263. X  extern char        directory[];
  264. X  
  265. X  int
  266. X--- 9,14 ----
  267. X*** @xfig.pl9/drag.c    Mon Apr 30 12:13:08 1990
  268. X--- ./drag.c    Mon Jun  3 11:13:34 1991
  269. X***************
  270. X*** 144,152 ****
  271. X      dx = cur_x - fix_x;
  272. X      dy = cur_y - fix_y;
  273. X      pw_vector(canvas_win, a->point[0].x+dx, a->point[0].y+dy,
  274. X!         a->point[1].x+dx, a->point[1].y+dy, op, 1, SOLID_LINE, 0.0);
  275. X      pw_vector(canvas_win, a->point[1].x+dx, a->point[1].y+dy,
  276. X!         a->point[2].x+dx, a->point[2].y+dy, op, 1, SOLID_LINE, 0.0);
  277. X      }
  278. X  
  279. X  /*************************  line  section  **********************/
  280. X--- 144,152 ----
  281. X      dx = cur_x - fix_x;
  282. X      dy = cur_y - fix_y;
  283. X      pw_vector(canvas_win, a->point[0].x+dx, a->point[0].y+dy,
  284. X!       a->point[1].x+dx, a->point[1].y+dy, op, 1, RUBBER_LINE, 0.0);
  285. X      pw_vector(canvas_win, a->point[1].x+dx, a->point[1].y+dy,
  286. X!       a->point[2].x+dx, a->point[2].y+dy, op, 1, RUBBER_LINE, 0.0);
  287. X      }
  288. X  
  289. X  /*************************  line  section  **********************/
  290. X***************
  291. X*** 200,206 ****
  292. X      y = p->y + dy;
  293. X      for (p = p->next; p != NULL; x = xx, y = yy, p = p->next) {
  294. X          xx = p->x + dx;  yy = p->y +dy;
  295. X!         pw_vector(canvas_win, x, y, xx, yy, op, 1, SOLID_LINE, 0.0);
  296. X          }
  297. X  }
  298. X  
  299. X--- 200,206 ----
  300. X      y = p->y + dy;
  301. X      for (p = p->next; p != NULL; x = xx, y = yy, p = p->next) {
  302. X          xx = p->x + dx;  yy = p->y +dy;
  303. X!         pw_vector(canvas_win, x, y, xx, yy, op, 1, RUBBER_LINE, 0.0);
  304. X          }
  305. X  }
  306. X  
  307. X***************
  308. X*** 221,229 ****
  309. X          {
  310. X          txsize = pf_textwidth(t->font, t->size, strlen(t->cstring), t->cstring);
  311. X          if (t->type == T_CENTER_JUSTIFIED)
  312. X!             x1off =  - txsize.x/2;
  313. X          else
  314. X!             x1off =  - txsize.x;
  315. X          fix_x = t->base_x;
  316. X          }
  317. X      else /* LEFT */
  318. X--- 221,229 ----
  319. X          {
  320. X          txsize = pf_textwidth(t->font, t->size, strlen(t->cstring), t->cstring);
  321. X          if (t->type == T_CENTER_JUSTIFIED)
  322. X!             x1off =  - txsize.x/2/zoomscale;
  323. X          else
  324. X!             x1off =  - txsize.x/zoomscale;
  325. X          fix_x = t->base_x;
  326. X          }
  327. X      else /* LEFT */
  328. X***************
  329. X*** 256,261 ****
  330. X--- 256,262 ----
  331. X      last_position.y = fix_y;
  332. X      translate_text(text, x - fix_x, y - fix_y);
  333. X      draw_text(text, PAINT);
  334. X+     show_pointmarker();
  335. X      set_modifiedflag();
  336. X      (*return_proc)();
  337. X      }
  338. X*** @xfig.pl9/draw.c    Mon Apr 16 11:24:55 1990
  339. X--- ./draw.c    Thu Jun 13 10:08:26 1991
  340. X***************
  341. X*** 10,15 ****
  342. X--- 10,16 ----
  343. X  #include "resources.h"
  344. X  #include "object.h"
  345. X  #include "paintop.h"
  346. X+ #include "zoom.h"
  347. X  
  348. X  extern int        pointmarker_shown, compoundbox_shown;
  349. X  extern int        background_color, foreground_color;
  350. X***************
  351. X*** 88,94 ****
  352. X      F_text    *t;
  353. X  
  354. X      for (t = texts; t != NULL; t = t->next) {
  355. X!         draw_text(t, INV_PAINT);
  356. X          };
  357. X      }
  358. X  
  359. X--- 89,95 ----
  360. X      F_text    *t;
  361. X  
  362. X      for (t = texts; t != NULL; t = t->next) {
  363. X!         draw_text(t, ERASE);
  364. X          };
  365. X      }
  366. X  
  367. X***************
  368. X*** 284,331 ****
  369. X      x = point->x;
  370. X      y = point->y;
  371. X      if (line->points->next == NULL) { /* A single point */
  372. X!         XDrawPoint(tool_d, canvas_win, gccache[op], x, y);
  373. X          return;
  374. X          }
  375. X      if (line->back_arrow) /* backward arrow  */
  376. X          draw_arrow(point->next->x, point->next->y, x, y, 
  377. X          line->back_arrow, op);
  378. X!     if (line->style == SOLID_LINE)    /* accumulate the points for solid line */
  379. X          {
  380. X!         npoints = 0;
  381. X!         /* count number of points in this object */
  382. X!         for ( ; point != NULL; point = point->next)
  383. X!             npoints++;
  384. X!         /* accumulate the points in an array */
  385. X!         if ((points = (XPoint *) malloc(npoints*sizeof(XPoint))) == 0)
  386. X!             {
  387. X!             fprintf(stderr,"draw_line(): No memory\n");
  388. X!             return;
  389. X!             }
  390. X!         pptr = points;
  391. X          }
  392. X!     for (point=line->points; point != NULL; point = point->next) {
  393. X!         if (line->style == SOLID_LINE)
  394. X!             {
  395. X!             pptr->x = point->x;
  396. X!             pptr->y = point->y;
  397. X!             pptr++;
  398. X!             }
  399. X!         else    /* draw dashed or dotted line segment by segment
  400. X!                otherwise when moving one segment later there
  401. X!                is an alignment problem with the dashes */
  402. X!         pw_vector(canvas_win, x, y, point->x, point->y, op,
  403. X!             line->thickness, line->style, line->style_val);
  404. X          xx = x; yy = y;
  405. X          x = point->x;
  406. X          y = point->y;
  407. X          }
  408. X!     if (line->style == SOLID_LINE)
  409. X!         {
  410. X!         pw_lines(canvas_win, points, npoints, op, 
  411. X          line->thickness, line->style, line->style_val, 0);
  412. X!         free(points);
  413. X!         }
  414. X      if (line->for_arrow) 
  415. X          draw_arrow(xx, yy, x, y, line->for_arrow, op);
  416. X      }
  417. X--- 285,319 ----
  418. X      x = point->x;
  419. X      y = point->y;
  420. X      if (line->points->next == NULL) { /* A single point */
  421. X!         zXDrawPoint(tool_d, canvas_win, gccache[op], x, y);
  422. X          return;
  423. X          }
  424. X      if (line->back_arrow) /* backward arrow  */
  425. X          draw_arrow(point->next->x, point->next->y, x, y, 
  426. X          line->back_arrow, op);
  427. X!     npoints = 0;
  428. X!     /* count number of points in this object */
  429. X!     for ( ; point != NULL; point = point->next)
  430. X!         npoints++;
  431. X!     /* accumulate the points in an array */
  432. X!     if ((points = (XPoint *) malloc(npoints*sizeof(XPoint))) == 0)
  433. X          {
  434. X!         fprintf(stderr,"draw_line(): No memory\n");
  435. X!         return;
  436. X          }
  437. X!     pptr = points;
  438. X!     for (point=line->points; point != NULL; point = point->next)
  439. X!         {
  440. X!         pptr->x = point->x;
  441. X!         pptr->y = point->y;
  442. X!         pptr++;
  443. X          xx = x; yy = y;
  444. X          x = point->x;
  445. X          y = point->y;
  446. X          }
  447. X!     pw_lines(canvas_win, points, npoints, op, 
  448. X          line->thickness, line->style, line->style_val, 0);
  449. X!     free(points);
  450. X      if (line->for_arrow) 
  451. X          draw_arrow(xx, yy, x, y, line->for_arrow, op);
  452. X      }
  453. X***************
  454. X*** 366,381 ****
  455. X      set_line_stuff(thick,style,val,op);
  456. X      gc = gccache[op];
  457. X      diam = 2*radius;
  458. X!     XDrawArc(tool_d, canvas_win, gc, xmin, ymin,
  459. X              diam, diam, 90*64, 90*64);
  460. X!     XDrawLine(tool_d, canvas_win, gc, xmin, ymin+radius, xmin, ymax-radius+1);
  461. X!     XDrawArc(tool_d, canvas_win, gc, xmin, ymax-diam,
  462. X              diam, diam, 180*64, 90*64);
  463. X!     XDrawLine(tool_d, canvas_win, gc, xmin+radius, ymax, xmax-radius+1, ymax);
  464. X!     XDrawArc(tool_d, canvas_win, gc, xmax-diam, ymax-diam,
  465. X              diam, diam, 270*64, 90*64);
  466. X!     XDrawLine(tool_d, canvas_win, gc, xmax, ymax-radius, xmax, ymin+radius-1);
  467. X!     XDrawArc(tool_d, canvas_win, gc, xmax-diam, ymin,
  468. X              diam, diam, 0*64, 90*64);
  469. X!     XDrawLine(tool_d, canvas_win, gc, xmax-radius, ymin, xmin+radius-1, ymin);
  470. X      }
  471. X--- 354,369 ----
  472. X      set_line_stuff(thick,style,val,op);
  473. X      gc = gccache[op];
  474. X      diam = 2*radius;
  475. X!     zXDrawArc(tool_d, canvas_win, gc, xmin, ymin,
  476. X              diam, diam, 90*64, 90*64);
  477. X!     zXDrawLine(tool_d, canvas_win, gc, xmin, ymin+radius, xmin, ymax-radius+1);
  478. X!     zXDrawArc(tool_d, canvas_win, gc, xmin, ymax-diam,
  479. X              diam, diam, 180*64, 90*64);
  480. X!     zXDrawLine(tool_d, canvas_win, gc, xmin+radius, ymax, xmax-radius+1, ymax);
  481. X!     zXDrawArc(tool_d, canvas_win, gc, xmax-diam, ymax-diam,
  482. X              diam, diam, 270*64, 90*64);
  483. X!     zXDrawLine(tool_d, canvas_win, gc, xmax, ymax-radius, xmax, ymin+radius-1);
  484. X!     zXDrawArc(tool_d, canvas_win, gc, xmax-diam, ymin,
  485. X              diam, diam, 0*64, 90*64);
  486. X!     zXDrawLine(tool_d, canvas_win, gc, xmax-radius, ymin, xmin+radius-1, ymin);
  487. X      }
  488. X*** @xfig.pl9/ellipse.c    Thu May  3 11:58:28 1990
  489. X--- ./ellipse.c    Mon Jun  3 11:13:50 1991
  490. X***************
  491. X*** 50,57 ****
  492. X  center_marker(x, y)
  493. X  int    x, y;
  494. X  {
  495. X!     pw_vector(canvas_win, x, y-2, x, y+2, INV_PAINT, 1, SOLID_LINE, 0.0);
  496. X!     pw_vector(canvas_win, x-2, y, x+2, y, INV_PAINT, 1, SOLID_LINE, 0.0);
  497. X      }
  498. X  
  499. X  ellipsebyradius_drawing_selected()
  500. X--- 50,57 ----
  501. X  center_marker(x, y)
  502. X  int    x, y;
  503. X  {
  504. X!     pw_vector(canvas_win, x, y-2, x, y+2, INV_PAINT, 1, RUBBER_LINE, 0.0);
  505. X!     pw_vector(canvas_win, x-2, y, x+2, y, INV_PAINT, 1, RUBBER_LINE, 0.0);
  506. X      }
  507. X  
  508. X  ellipsebyradius_drawing_selected()
  509. X***************
  510. X*** 118,124 ****
  511. X      ellipse->type = T_ELLIPSE_BY_RAD;
  512. X      ellipse->style = line_style;
  513. X      ellipse->thickness = line_thickness;
  514. X!     ellipse->style_val = cur_styleval;
  515. X      ellipse->angle = cur_angle;
  516. X      ellipse->color = cur_color;
  517. X      ellipse->depth = 0;
  518. X--- 118,124 ----
  519. X      ellipse->type = T_ELLIPSE_BY_RAD;
  520. X      ellipse->style = line_style;
  521. X      ellipse->thickness = line_thickness;
  522. X!     ellipse->style_val = cur_styleval*(line_thickness+1)/2;
  523. X      ellipse->angle = cur_angle;
  524. X      ellipse->color = cur_color;
  525. X      ellipse->depth = 0;
  526. X***************
  527. X*** 198,204 ****
  528. X      ellipse->type = T_ELLIPSE_BY_DIA;
  529. X      ellipse->style = line_style;
  530. X      ellipse->thickness = line_thickness;
  531. X!     ellipse->style_val = cur_styleval;
  532. X      ellipse->angle = cur_angle;
  533. X      ellipse->color = cur_color;
  534. X      ellipse->depth = 0;
  535. X--- 198,204 ----
  536. X      ellipse->type = T_ELLIPSE_BY_DIA;
  537. X      ellipse->style = line_style;
  538. X      ellipse->thickness = line_thickness;
  539. X!     ellipse->style_val = cur_styleval*(line_thickness+1)/2;
  540. X      ellipse->angle = cur_angle;
  541. X      ellipse->color = cur_color;
  542. X      ellipse->depth = 0;
  543. X***************
  544. X*** 274,280 ****
  545. X      y1 = fix_y + radius;
  546. X      y2 = fix_y - radius;
  547. X      draw_rectbox(x1, y1, x2, y2, op);
  548. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  549. X      }
  550. X  
  551. X  create_circlebyrad(x, y)
  552. X--- 274,280 ----
  553. X      y1 = fix_y + radius;
  554. X      y2 = fix_y - radius;
  555. X      draw_rectbox(x1, y1, x2, y2, op);
  556. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
  557. X      }
  558. X  
  559. X  create_circlebyrad(x, y)
  560. X***************
  561. X*** 293,299 ****
  562. X      c->type = T_CIRCLE_BY_RAD;
  563. X      c->style = line_style;
  564. X      c->thickness = line_thickness;
  565. X!     c->style_val = cur_styleval;
  566. X      c->angle = 0.0;
  567. X      c->color = cur_color;
  568. X      c->depth = 0;
  569. X--- 293,299 ----
  570. X      c->type = T_CIRCLE_BY_RAD;
  571. X      c->style = line_style;
  572. X      c->thickness = line_thickness;
  573. X!     c->style_val = cur_styleval*(line_thickness+1)/2;
  574. X      c->angle = 0.0;
  575. X      c->color = cur_color;
  576. X      c->depth = 0;
  577. X***************
  578. X*** 367,373 ****
  579. X      y1 = fix_y + ry + radius;
  580. X      y2 = fix_y + ry - radius;
  581. X      draw_rectbox(x1, y1, x2, y2, op);
  582. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
  583. X      }
  584. X  
  585. X  create_circlebydia(x, y)
  586. X--- 367,373 ----
  587. X      y1 = fix_y + ry + radius;
  588. X      y2 = fix_y + ry - radius;
  589. X      draw_rectbox(x1, y1, x2, y2, op);
  590. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
  591. X      }
  592. X  
  593. X  create_circlebydia(x, y)
  594. X***************
  595. X*** 386,392 ****
  596. X      c->type = T_CIRCLE_BY_DIA;
  597. X      c->style = line_style;
  598. X      c->thickness = line_thickness;
  599. X!     c->style_val = cur_styleval;
  600. X      c->angle = 0.0;
  601. X      c->color = cur_color;
  602. X      c->depth = 0;
  603. X--- 386,392 ----
  604. X      c->type = T_CIRCLE_BY_DIA;
  605. X      c->style = line_style;
  606. X      c->thickness = line_thickness;
  607. X!     c->style_val = cur_styleval*(line_thickness+1)/2;
  608. X      c->angle = 0.0;
  609. X      c->color = cur_color;
  610. X      c->depth = 0;
  611. X*** @xfig.pl9/f2ps.c    Wed Aug  1 13:24:30 1990
  612. X--- ./f2ps.c    Mon Jun  3 13:25:16 1991
  613. X***************
  614. X*** 26,31 ****
  615. X--- 26,32 ----
  616. X  char        *prog;
  617. X  char        *font = DEFAULT_FONT;
  618. X  int        font_size = DEFAULT_FONT_SIZE;
  619. X+ int        font_number = 0;
  620. X  int        cur_thickness;
  621. X  int        cur_areafill=0;
  622. X  int        show_page = 1;
  623. X***************
  624. X*** 110,118 ****
  625. X--- 111,127 ----
  626. X  {
  627. X      F_compound    objects;
  628. X      int        status;
  629. X+     int i;
  630. X  
  631. X      get_args(argc, argv);
  632. X  
  633. X+     for (i = 0; i < NUMFONTS; i++)
  634. X+       if (strcmp(font, fontnames[i].psfont) ==  0)
  635. X+         {
  636. X+           font_number = i;
  637. X+           break;
  638. X+         }
  639. X+ 
  640. X      if (to == NULL)
  641. X          tfp = stdout;
  642. X      else if ((tfp = fopen(to, "w")) == NULL) {
  643. X***************
  644. X*** 409,415 ****
  645. X          return;
  646. X          }
  647. X      if (l->back_arrow)
  648. X!         draw_arrow_head((float)q->x, (float)q->y, (float)p->x,
  649. X              (float)p->y, l->back_arrow->ht, l->back_arrow->wid);
  650. X      set_style(l->style, l->style_val);
  651. X      fprintf(tfp, "%% Polyline\n");
  652. X--- 418,424 ----
  653. X          return;
  654. X          }
  655. X      if (l->back_arrow)
  656. X!         draw_arrow_head((float)q->x, (float)q->y, (float)p->x,
  657. X              (float)p->y, l->back_arrow->ht, l->back_arrow->wid);
  658. X      set_style(l->style, l->style_val);
  659. X      fprintf(tfp, "%% Polyline\n");
  660. X***************
  661. X*** 657,662 ****
  662. X--- 666,674 ----
  663. X              for (j=0; j<MAX_FONT_SIZES; j++)
  664. X              first[i][j] = 0;
  665. X  
  666. X+     if (t->font == -1) t->font = font_number;
  667. X+     if (t->size == -1) t->size = font_size;
  668. X+ 
  669. X      /* if different font or different size, choose new */
  670. X      if (current_font != t->font || current_size != t->size)
  671. X          {
  672. X***************
  673. X*** 782,788 ****
  674. X  
  675. X      dx = x2 - x1;  dy = y1 - y2;
  676. X      l = sqrt((double)(dx*dx + dy*dy));    /* length of line */
  677. X!     sina = dy / l;  cosa = dx / l;
  678. X      xb = x2*cosa - y2*sina;
  679. X      yb = x2*sina + y2*cosa;
  680. X      x = xb - arrowht;
  681. X--- 794,806 ----
  682. X  
  683. X      dx = x2 - x1;  dy = y1 - y2;
  684. X      l = sqrt((double)(dx*dx + dy*dy));    /* length of line */
  685. X!     if (l == 0)                /* uh-oh, zero-length line */
  686. X!         return;
  687. X!     else
  688. X!         {
  689. X!         sina = dy / l;
  690. X!         cosa = dx / l;
  691. X!         }
  692. X      xb = x2*cosa - y2*sina;
  693. X      yb = x2*sina + y2*cosa;
  694. X      x = xb - arrowht;
  695. X*** @xfig.pl9/fig.h    Thu Aug  2 11:20:25 1990
  696. X--- ./fig.h    Mon Jun  3 10:56:14 1991
  697. X***************
  698. X*** 19,24 ****
  699. X--- 19,29 ----
  700. X  #include <stdio.h>
  701. X  #include <ctype.h>
  702. X  #include <errno.h>
  703. X+ 
  704. X+ extern    int    errno;
  705. X+ extern    int    sys_nerr;
  706. X+ extern    char    *sys_errlist[];
  707. X+ 
  708. X  #include <math.h>
  709. X  
  710. X  #ifdef SYSV
  711. X*** @xfig.pl9/font.c    Thu Jul  5 09:50:39 1990
  712. X--- ./font.c    Mon Jun  3 13:25:16 1991
  713. X***************
  714. X*** 54,59 ****
  715. X--- 54,63 ----
  716. X          gc_fontsize[i] = 0;
  717. X          }
  718. X  
  719. X+ /* OpenWindows can make any of the LaserWriter fonts at any size so this next code is
  720. X+        not necessary for OpenWindows */
  721. X+ 
  722. X+ #ifndef OPENWIN
  723. X      /* Now initialize the font structure for the X fonts corresponding
  724. X         to the Postscript fonts for the canvas */
  725. X  
  726. X***************
  727. X*** 70,76 ****
  728. X              flist[p].fn = *fname++;    /* save name of this size font */
  729. X              flist[p++].s = ss;        /* and save size */
  730. X              }
  731. X!         for (ss=4; ss<=40; ss++)
  732. X              {
  733. X              for (i=0; i<p; i++)
  734. X              if (flist[i].s == ss)
  735. X--- 74,80 ----
  736. X              flist[p].fn = *fname++;    /* save name of this size font */
  737. X              flist[p++].s = ss;        /* and save size */
  738. X              }
  739. X!         for (ss=4; ss<=50; ss++) /* 40 substituted by 50 by ges */
  740. X              {
  741. X              for (i=0; i<p; i++)
  742. X              if (flist[i].s == ss)
  743. X***************
  744. X*** 92,97 ****
  745. X--- 96,102 ----
  746. X              }
  747. X          }
  748. X          } /* next font, f */
  749. X+ #endif  /* OPENWIN */
  750. X      }
  751. X  
  752. X  /* parse the point size of font 'name' */
  753. X***************
  754. X*** 126,136 ****
  755. X--- 131,154 ----
  756. X      {
  757. X      struct    xfont *xf;
  758. X      XFontStruct *fontst;
  759. X+     char fn[128];
  760. X  
  761. X      if (f<0)            /* use font 0 for default font (-1) */
  762. X          f=0;
  763. X      if (s<0)
  764. X          s=DEF_PRINTFONTSIZE;    /* default font size */
  765. X+ 
  766. X+ #ifdef OPENWIN
  767. X+     sprintf (fn, "%s-%d", fontnames[f].psfont, s);
  768. X+     lower(fn);
  769. X+     if (appres.DEBUG)
  770. X+         fprintf(stderr,"Loading font %s\n",fn);
  771. X+     fontst = XLoadQueryFont(tool_d, fn);
  772. X+     if (fontst == NULL)
  773. X+         fprintf(stderr,"What!!?!?! Can't find font %s\n",fn);
  774. X+     return fontst;
  775. X+ 
  776. X+ #else   /* !OPENWIN */
  777. X      xf = fontnames[f].xfontlist;    /* go through the linked list looking for match */
  778. X      if (xf == NULL)
  779. X          return roman_font;    /* use a default font */
  780. X***************
  781. X*** 156,159 ****
  782. X--- 174,178 ----
  783. X              fprintf(stderr,"What!!?!?! Can't find font %s\n",xf->fname);
  784. X          }
  785. X      return xf->fstruct;
  786. X+ #endif  /* !OPENWIN */
  787. X      }
  788. X*** @xfig.pl9/func.h    Thu Sep 20 16:27:46 1990
  789. X--- ./func.h    Mon Jun  3 11:16:30 1991
  790. X***************
  791. X*** 99,102 ****
  792. X--- 99,105 ----
  793. X  #define            F_LATEX_LINE        280  /*fs*/
  794. X  #define            F_LATEX_ARROW        281  /*fs*/
  795. X  
  796. X+ #define            F_ZOOM            290
  797. X+ #define         F_PAN            291
  798. X+ 
  799. X  #define            F_NOP            999
  800. X*** @xfig.pl9/geom.c    Tue Jan 16 17:21:06 1990
  801. X--- ./geom.c    Mon Jun  3 13:25:16 1991
  802. X***************
  803. X*** 126,131 ****
  804. X--- 126,133 ----
  805. X  
  806. X      dx12 = p1.x - p2.x;  dy12 = p1.y - p2.y;
  807. X      dx13 = p1.x - p3.x;  dy13 = p1.y - p3.y;
  808. X+     if (dx13==0 || dy13==0)
  809. X+         return(0);
  810. X      s12 = asin((double)(dy12 / sqrt((double)(dx12*dx12 + dy12*dy12))));
  811. X      s13 = asin((double)(dy13 / sqrt((double)(dx13*dx13 + dy13*dy13))));
  812. X      if (fabs(s12 - s13) < .01) return(0);
  813. X*** @xfig.pl9/global.c    Tue Jul 31 11:35:13 1990
  814. X--- ./global.c    Fri Jun 14 10:16:35 1991
  815. X***************
  816. X*** 82,87 ****
  817. X--- 82,88 ----
  818. X  int            latexline_mode        = 0;
  819. X  int            latexarrow_mode        = 0;
  820. X  int            magnet_mode        = 0;
  821. X+ int            grid2_mode        = 0;
  822. X  int            line_thickness        = 1;
  823. X  int            line_style        = SOLID_LINE;
  824. X  int            cur_radius        = 7;
  825. X***************
  826. X*** 102,108 ****
  827. X  float            cur_dotgap        = 3;
  828. X  float            cur_styleval        = 0.0;
  829. X  float            cur_angle        = 0.0;
  830. X! int            cur_color        = BLACK;
  831. X  int            cur_textstyle        = PLAIN;
  832. X  int            cur_textjust        = T_LEFT_JUSTIFIED;
  833. X          /* line thicknesses for each gc */
  834. X--- 103,109 ----
  835. X  float            cur_dotgap        = 3;
  836. X  float            cur_styleval        = 0.0;
  837. X  float            cur_angle        = 0.0;
  838. X! int            cur_color        = -1;    /* default color to start */
  839. X  int            cur_textstyle        = PLAIN;
  840. X  int            cur_textjust        = T_LEFT_JUSTIFIED;
  841. X          /* line thicknesses for each gc */
  842. X*** @xfig.pl9/glue.c    Mon Apr 30 12:13:20 1990
  843. X--- ./glue.c    Mon Jun  3 13:25:16 1991
  844. X***************
  845. X*** 14,20 ****
  846. X  #include "object.h"
  847. X  #include "paintop.h"
  848. X  
  849. X- #define            TOLERANCE    7
  850. X  #define            min(a, b)    (((a) < (b)) ? (a) : (b))
  851. X  #define            max(a, b)    (((a) > (b)) ? (a) : (b))
  852. X  
  853. X--- 14,19 ----
  854. X***************
  855. X*** 368,374 ****
  856. X  F_compound    *c;
  857. X  {
  858. X      draw_compoundelements(c, background_color, background_color,
  859. X!                 ERASE, ERASE, INV_PAINT, ERASE);
  860. X      }
  861. X  
  862. X  draw_compoundelements(c, arcop, ellipseop, lineop, splineop, textop, compop)
  863. X--- 367,373 ----
  864. X  F_compound    *c;
  865. X  {
  866. X      draw_compoundelements(c, background_color, background_color,
  867. X!                 ERASE, ERASE, ERASE, ERASE);
  868. X      }
  869. X  
  870. X  draw_compoundelements(c, arcop, ellipseop, lineop, splineop, textop, compop)
  871. X*** @xfig.pl9/grid.c    Mon Apr 16 11:25:54 1990
  872. X--- ./grid.c    Mon Jun  3 11:14:02 1991
  873. X***************
  874. X*** 21,65 ****
  875. X  #define null_height 32
  876. X  static char null_bits[null_width * null_height / 8] = { 0 };
  877. X  
  878. X! #define quarter_width 20
  879. X! #define quarter_height 20
  880. X! static char quarter_bits[] = {
  881. X!    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  882. X!    0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  883. X!    0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  884. X!    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
  885. X!    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x42, 0x08};
  886. X  
  887. X- #define half_width 40
  888. X- #define half_height 40
  889. X- static char half_bits[] = {
  890. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  891. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  892. X-    0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  893. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  894. X-    0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  895. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  896. X-    0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  897. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  898. X-    0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  899. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  900. X-    0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  901. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  902. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  903. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  904. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
  905. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  906. X-    0x00, 0x00, 0x00, 0x10, 0x42, 0x08, 0x21, 0x84};
  907. X- 
  908. X- #define half_cm_width 15
  909. X- #define half_cm_height 15
  910. X- static char half_cm_bits[] = {
  911. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00,
  912. X-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
  913. X-    0x00, 0x00, 0x00, 0x00, 0x10, 0x42, 0x00, 0x00};
  914. X- 
  915. X- static Pixmap    null_pm, quarter_pm, half_pm, half_cm_pm;
  916. X- 
  917. X  init_grid()
  918. X  {
  919. X      unsigned long bg, fg;
  920. X--- 21,28 ----
  921. X  #define null_height 32
  922. X  static char null_bits[null_width * null_height / 8] = { 0 };
  923. X  
  924. X! static Pixmap   null_pm, grid_pm=0;
  925. X  
  926. X  init_grid()
  927. X  {
  928. X      unsigned long bg, fg;
  929. X***************
  930. X*** 72,111 ****
  931. X      null_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
  932. X          null_bits, null_width, null_height,
  933. X          fg, bg,    DefaultDepthOfScreen(tool_s));
  934. X-     quarter_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
  935. X-         quarter_bits, quarter_width, quarter_height,
  936. X-         fg, bg,    DefaultDepthOfScreen(tool_s));
  937. X-     half_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
  938. X-         half_bits, half_width, half_height,
  939. X-         fg, bg,    DefaultDepthOfScreen(tool_s));
  940. X-     half_cm_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
  941. X-         half_cm_bits, half_cm_width, half_cm_height,
  942. X-         fg, bg, DefaultDepthOfScreen(tool_s));
  943. X  }
  944. X  
  945. X  /* grid in X11 is simply the background of the canvas */
  946. X  
  947. X  setup_grid(grid)
  948. X!     int        grid;
  949. X  {
  950. X!     static Arg    grid_args[] =
  951. X!     {
  952. X!         { XtNbackgroundPixmap, (XtArgVal)NULL },
  953. X!     };
  954. X  
  955. X      if (grid == cur_grid)
  956. X      {
  957. X          grid_args[0].value = (XtArgVal)null_pm;
  958. X          grid = -1;
  959. X      }
  960. X!     if( appres.INCHES )
  961. X!     {
  962. X!         if (grid == F_GRID1)
  963. X!             grid_args[0].value = (XtArgVal)quarter_pm;
  964. X!         else if (grid == F_GRID2)
  965. X!             grid_args[0].value = (XtArgVal)half_pm;
  966. X!     }else if (grid == F_GRID1 || grid == F_GRID2)
  967. X!         grid_args[0].value = (XtArgVal)half_cm_pm;
  968. X      cur_grid = grid;
  969. X      XtSetValues(canvas_sw, grid_args, XtNumber(grid_args));
  970. X  }
  971. X--- 35,116 ----
  972. X      null_pm = XCreatePixmapFromBitmapData(tool_d, canvas_win,
  973. X          null_bits, null_width, null_height,
  974. X          fg, bg,    DefaultDepthOfScreen(tool_s));
  975. X  }
  976. X  
  977. X  /* grid in X11 is simply the background of the canvas */
  978. X  
  979. X  setup_grid(grid)
  980. X! int        grid;
  981. X  {
  982. X!     int coarse,fine,x,y,x0c,y0c,x0f,y0f,dim;
  983. X!     unsigned long bg, fg;
  984. X!     static Arg grid_args[]={{XtNbackgroundPixmap, (XtArgVal)NULL},};
  985. X!     Arg    tmp_arg[3];
  986. X  
  987. X+     XtSetArg(tmp_arg[0], XtNbackground, &bg);
  988. X+     XtSetArg(tmp_arg[1], XtNforeground, &fg);
  989. X+     XtGetValues(canvas_sw, tmp_arg, 2);
  990. X+ 
  991. X+     /* If there is a grid, the canvas will be redisplayed later on.
  992. X+        If there is no grid, redisplay the canvas here. */
  993. X+         if (grid==0 && cur_grid==-1) 
  994. X+     { redisplay_canvas(); 
  995. X+       return;
  996. X+     }
  997. X      if (grid == cur_grid)
  998. X      {
  999. X          grid_args[0].value = (XtArgVal)null_pm;
  1000. X          grid = -1;
  1001. X      }
  1002. X!     else
  1003. X!     { if (grid==0) grid=cur_grid; /* rezoom grid */
  1004. X!       if (appres.INCHES)
  1005. X!         if (grid==F_GRID1)
  1006. X!         { coarse=20*zoomscale;
  1007. X!           fine=5*zoomscale;
  1008. X!         }
  1009. X!         else
  1010. X!         { coarse=40*zoomscale;
  1011. X!           fine=5*zoomscale;
  1012. X!         }
  1013. X!       else
  1014. X!         if (grid==F_GRID1)
  1015. X!         { coarse=15*zoomscale;
  1016. X!           fine=3*zoomscale;
  1017. X!         }
  1018. X!         else
  1019. X!         { coarse=15*zoomscale;
  1020. X!           fine=0;
  1021. X!         }
  1022. X!       dim=(coarse>64)? coarse : (64/coarse+1)*coarse;
  1023. X!       if (grid_pm) XFreePixmap(tool_d,grid_pm);
  1024. X!       grid_pm=XCreatePixmap(tool_d,canvas_win,dim,dim,
  1025. X!                   DefaultDepthOfScreen(tool_s));
  1026. X!       XSetForeground(tool_d,gc,bg);
  1027. X!       XFillRectangle(tool_d,grid_pm,gc,0,0,dim,dim);
  1028. X!       x0c= -(zoomscale*zoomxoff)%coarse-zoomscale;
  1029. X!       y0c= -(zoomscale*zoomyoff)%coarse-zoomscale;
  1030. X!       if (fine)
  1031. X!       { x0f= -(zoomscale*zoomxoff)%fine-zoomscale;
  1032. X!         y0f= -(zoomscale*zoomyoff)%fine-zoomscale;
  1033. X!       }
  1034. X!       XSetForeground(tool_d,gc,fg);
  1035. X!       if (fine)
  1036. X!       { for (x=x0c;x<dim;x+=coarse)
  1037. X!           for (y=y0f;y<dim;y+=fine)
  1038. X!         XDrawPoint(tool_d,grid_pm,gc,x,y);
  1039. X!         for (y=y0c;y<dim;y+=coarse)
  1040. X!           for (x=x0f;x<dim;x+=fine)
  1041. X!         XDrawPoint(tool_d,grid_pm,gc,x,y);
  1042. X!       }
  1043. X!       else
  1044. X!       { for (x=x0c;x<dim;x+=coarse)
  1045. X!           for (y=y0c;y<dim;y+=coarse)
  1046. X!         XDrawPoint(tool_d,grid_pm,gc,x,y);
  1047. X!       }
  1048. X!       grid_args[0].value = (XtArgVal)grid_pm;
  1049. X! 
  1050. X!     }
  1051. X      cur_grid = grid;
  1052. X      XtSetValues(canvas_sw, grid_args, XtNumber(grid_args));
  1053. X  }
  1054. X*** @xfig.pl9/intspline.c    Tue May  1 16:23:12 1990
  1055. X--- ./intspline.c    Mon Jun  3 13:25:16 1991
  1056. X***************
  1057. X*** 69,75 ****
  1058. X      draw_elasticline();
  1059. X      if (num_point <= 2) {
  1060. X          pw_vector(canvas_win, first_point->x, first_point->y,
  1061. X!             cur_point->x, cur_point->y, PAINT, 1, SOLID_LINE, 0.0);
  1062. X          if (num_point == 1) {
  1063. X          free((char*)cur_point);
  1064. X          cur_point = NULL;
  1065. X--- 69,75 ----
  1066. X      draw_elasticline();
  1067. X      if (num_point <= 2) {
  1068. X          pw_vector(canvas_win, first_point->x, first_point->y,
  1069. X!             cur_point->x, cur_point->y, PAINT, 1, RUBBER_LINE, 0.0);
  1070. X          if (num_point == 1) {
  1071. X          free((char*)cur_point);
  1072. X          cur_point = NULL;
  1073. X***************
  1074. X*** 91,97 ****
  1075. X          }
  1076. X      spline->style = line_style;
  1077. X      spline->thickness = line_thickness;
  1078. X!     spline->style_val = cur_styleval;
  1079. X      spline->color = cur_color;
  1080. X      spline->depth = 0;
  1081. X      spline->area_fill = 0;
  1082. X--- 91,97 ----
  1083. X          }
  1084. X      spline->style = line_style;
  1085. X      spline->thickness = line_thickness;
  1086. X!     spline->style_val = cur_styleval*(line_thickness+1)/2;
  1087. X      spline->color = cur_color;
  1088. X      spline->depth = 0;
  1089. X      spline->area_fill = 0;
  1090. X***************
  1091. X*** 228,242 ****
  1092. X      dx = x1 - x2;
  1093. X      dy = y2 - y1;
  1094. X      l1 = sqrt((double)(dx*dx + dy*dy));
  1095. X!     theta1 = atan2((double)dy, (double)dx);
  1096. X      dx = x3 - x2;
  1097. X      dy = y2 - y3;
  1098. X      l2 = sqrt((double)(dx*dx + dy*dy));
  1099. X!     theta2 = atan2((double)dy, (double)dx);
  1100. X!     /* -PI <= theat1, theta2 <= PI */
  1101. X      if (theta1 < 0) theta1 += _2xPI;
  1102. X      if (theta2 < 0) theta2 += _2xPI;
  1103. X!     /* 0 <= theat1, theta2 < 2PI */
  1104. X  
  1105. X      cp = controls->next;
  1106. X      control_points(x2, y2, l1, l2, theta1, theta2, T, cp);
  1107. X--- 228,248 ----
  1108. X      dx = x1 - x2;
  1109. X      dy = y2 - y1;
  1110. X      l1 = sqrt((double)(dx*dx + dy*dy));
  1111. X!     if (l1==0.0)
  1112. X!         theta1 = 0.0;
  1113. X!     else
  1114. X!         theta1 = atan2((double)dy, (double)dx);
  1115. X      dx = x3 - x2;
  1116. X      dy = y2 - y3;
  1117. X      l2 = sqrt((double)(dx*dx + dy*dy));
  1118. X!     if (l2==0.0)
  1119. X!         theta2 = 0.0;
  1120. X!     else
  1121. X!         theta2 = atan2((double)dy, (double)dx);
  1122. X!     /* -PI <= theta1, theta2 <= PI */
  1123. X      if (theta1 < 0) theta1 += _2xPI;
  1124. X      if (theta2 < 0) theta2 += _2xPI;
  1125. X!     /* 0 <= theta1, theta2 < 2PI */
  1126. X  
  1127. X      cp = controls->next;
  1128. X      control_points(x2, y2, l1, l2, theta1, theta2, T, cp);
  1129. X***************
  1130. X*** 260,266 ****
  1131. X          dx = x3 - x2;
  1132. X          dy = y2 - y3;
  1133. X          l2 = sqrt((double)(dx*dx + dy*dy));
  1134. X!         theta2 = atan2((double)dy, (double)dx);
  1135. X          if (theta2 < 0) theta2 += _2xPI;
  1136. X          cp = cp->next;
  1137. X          control_points(x2, y2, l1, l2, theta1, theta2, T, cp);
  1138. X--- 266,275 ----
  1139. X          dx = x3 - x2;
  1140. X          dy = y2 - y3;
  1141. X          l2 = sqrt((double)(dx*dx + dy*dy));
  1142. X!         if (l2==0.0)
  1143. X!         theta2 = 0.0;
  1144. X!         else
  1145. X!         theta2 = atan2((double)dy, (double)dx);
  1146. X          if (theta2 < 0) theta2 += _2xPI;
  1147. X          cp = cp->next;
  1148. X          control_points(x2, y2, l1, l2, theta1, theta2, T, cp);
  1149. X***************
  1150. X*** 296,302 ****
  1151. X  {
  1152. X      float    s, theta, r = 1 - t;
  1153. X  
  1154. X!     /* 0 <= theat1, theta2 < 2PI */
  1155. X  
  1156. X      theta = (theta1 + theta2) / 2;
  1157. X  
  1158. X--- 305,311 ----
  1159. X  {
  1160. X      float    s, theta, r = 1 - t;
  1161. X  
  1162. X!     /* 0 <= theta1, theta2 < 2PI */
  1163. X  
  1164. X      theta = (theta1 + theta2) / 2;
  1165. X  
  1166. X*** @xfig.pl9/line.c    Mon Apr 30 12:13:27 1990
  1167. X--- ./line.c    Mon Jun  3 11:14:12 1991
  1168. X***************
  1169. X*** 13,18 ****
  1170. X--- 13,19 ----
  1171. X  #include "func.h"
  1172. X  #include "object.h"
  1173. X  #include "paintop.h"
  1174. X+ #include "zoom.h"
  1175. X  
  1176. X  extern            (*canvas_kbd_proc)();
  1177. X  extern            (*canvas_locmove_proc)();
  1178. X***************
  1179. X*** 29,34 ****
  1180. X--- 30,37 ----
  1181. X  extern int        manhattan_mode, mountain_mode;
  1182. X  extern int        latexline_mode, latexarrow_mode;
  1183. X  extern int        magnet_mode, latexarrow_mode;
  1184. X+ extern int        grid2_mode;
  1185. X+ extern  appresStruct    appres;
  1186. X  extern int        autoforwardarrow_mode, autobackwardarrow_mode;
  1187. X  extern int        line_style, line_thickness;
  1188. X  extern float        cur_styleval;
  1189. X***************
  1190. X*** 105,111 ****
  1191. X  draw_elasticline()
  1192. X  {
  1193. X      pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, 
  1194. X!         INV_PAINT, 1, SOLID_LINE, 0.0);
  1195. X      }
  1196. X  
  1197. X  freehand_elasticline(x, y)
  1198. X--- 108,114 ----
  1199. X  draw_elasticline()
  1200. X  {
  1201. X      pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, 
  1202. X!         INV_PAINT, 1, RUBBER_LINE, 0.0);
  1203. X      }
  1204. X  
  1205. X  freehand_elasticline(x, y)
  1206. X***************
  1207. X*** 122,129 ****
  1208. X      int  x, y;
  1209. X      CURSOR c;
  1210. X  
  1211. X!     latex_endpoint(fix_x, fix_y, cur_x, cur_y, &x, &y, latexarrow_mode, (magnet_mode)? 5: 1);
  1212. X!     pw_vector(canvas_win, fix_x, fix_y, x, y, INV_PAINT,1,SOLID_LINE, 0.0);
  1213. X      c = (x == cur_x  &&  y == cur_y)? &null_cursor: &crosshair_cursor;
  1214. X      if (c != cur_cursor) {
  1215. X          set_temp_cursor(c);
  1216. X--- 125,132 ----
  1217. X      int  x, y;
  1218. X      CURSOR c;
  1219. X  
  1220. X!     latex_endpoint(fix_x, fix_y, cur_x, cur_y, &x, &y, latexarrow_mode, (magnet_mode)? (appres.INCHES? 5:(grid2_mode? 15:3)): 1);
  1221. X!     pw_vector(canvas_win, fix_x, fix_y, x, y, INV_PAINT,1,RUBBER_LINE, 0.0);
  1222. X      c = (x == cur_x  &&  y == cur_y)? &null_cursor: &crosshair_cursor;
  1223. X      if (c != cur_cursor) {
  1224. X          set_temp_cursor(c);
  1225. X***************
  1226. X*** 144,152 ****
  1227. X  int    x, y;
  1228. X  {
  1229. X      if (x == cur_x && y == cur_y) return;
  1230. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
  1231. X      cur_x = x;
  1232. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
  1233. X      win_setmouseposition(canvas_win, cur_x, cur_y);
  1234. X      }
  1235. X  
  1236. X--- 147,155 ----
  1237. X  int    x, y;
  1238. X  {
  1239. X      if (x == cur_x && y == cur_y) return;
  1240. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
  1241. X      cur_x = x;
  1242. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
  1243. X      win_setmouseposition(canvas_win, cur_x, cur_y);
  1244. X      }
  1245. X  
  1246. X***************
  1247. X*** 154,162 ****
  1248. X  int    x, y;
  1249. X  {
  1250. X      if (x == cur_x && y == cur_y) return;
  1251. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
  1252. X      cur_y = y;
  1253. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
  1254. X      win_setmouseposition(canvas_win, cur_x, cur_y);
  1255. X      }
  1256. X  
  1257. X--- 157,165 ----
  1258. X  int    x, y;
  1259. X  {
  1260. X      if (x == cur_x && y == cur_y) return;
  1261. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
  1262. X      cur_y = y;
  1263. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
  1264. X      win_setmouseposition(canvas_win, cur_x, cur_y);
  1265. X      }
  1266. X  
  1267. X***************
  1268. X*** 164,170 ****
  1269. X  int    x, y;
  1270. X  {
  1271. X      if (x == cur_x && y == cur_y) return;
  1272. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
  1273. X      if (abs(x - cur_x) < abs(y - cur_y)) {
  1274. X          cur_x += cur_y - y;
  1275. X          cur_y = y;
  1276. X--- 167,173 ----
  1277. X  int    x, y;
  1278. X  {
  1279. X      if (x == cur_x && y == cur_y) return;
  1280. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
  1281. X      if (abs(x - cur_x) < abs(y - cur_y)) {
  1282. X          cur_x += cur_y - y;
  1283. X          cur_y = y;
  1284. X***************
  1285. X*** 173,179 ****
  1286. X          cur_y -= x - cur_x;
  1287. X          cur_x = x;
  1288. X          }
  1289. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
  1290. X      win_setmouseposition(canvas_win, cur_x, cur_y);
  1291. X      }
  1292. X  
  1293. X--- 176,182 ----
  1294. X          cur_y -= x - cur_x;
  1295. X          cur_x = x;
  1296. X          }
  1297. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
  1298. X      win_setmouseposition(canvas_win, cur_x, cur_y);
  1299. X      }
  1300. X  
  1301. X***************
  1302. X*** 181,187 ****
  1303. X  int    x, y;
  1304. X  {
  1305. X      if (x == cur_x && y == cur_y) return;
  1306. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
  1307. X      if (abs(x - cur_x) < abs(y - cur_y)) {
  1308. X          cur_x += y - cur_y;
  1309. X          cur_y = y;
  1310. X--- 184,190 ----
  1311. X  int    x, y;
  1312. X  {
  1313. X      if (x == cur_x && y == cur_y) return;
  1314. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
  1315. X      if (abs(x - cur_x) < abs(y - cur_y)) {
  1316. X          cur_x += y - cur_y;
  1317. X          cur_y = y;
  1318. X***************
  1319. X*** 190,196 ****
  1320. X          cur_y += x - cur_x;
  1321. X          cur_x = x;
  1322. X          }
  1323. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,SOLID_LINE, 0.0);
  1324. X      win_setmouseposition(canvas_win, cur_x, cur_y);
  1325. X      }
  1326. X  
  1327. X--- 193,199 ----
  1328. X          cur_y += x - cur_x;
  1329. X          cur_x = x;
  1330. X          }
  1331. X!     pw_vector(canvas_win, fix_x, fix_y, cur_x, cur_y, INV_PAINT,1,RUBBER_LINE, 0.0);
  1332. X      win_setmouseposition(canvas_win, cur_x, cur_y);
  1333. X      }
  1334. X  
  1335. X***************
  1336. X*** 240,246 ****
  1337. X  int    x, y;
  1338. X  {
  1339. X      draw_latexline();
  1340. X!     latex_endpoint(fix_x, fix_y, x, y, &cur_x, &cur_y, latexarrow_mode, (magnet_mode)? 5: 1);
  1341. X      if (cur_cursor != &null_cursor) {
  1342. X          set_temp_cursor(&null_cursor);
  1343. X          cur_cursor = &null_cursor;
  1344. X--- 243,249 ----
  1345. X  int    x, y;
  1346. X  {
  1347. X      draw_latexline();
  1348. X!     latex_endpoint(fix_x, fix_y, x, y, &cur_x, &cur_y, latexarrow_mode, (magnet_mode)? (appres.INCHES? 5:(grid2_mode? 15:3)): 1);
  1349. X      if (cur_cursor != &null_cursor) {
  1350. X          set_temp_cursor(&null_cursor);
  1351. X          cur_cursor = &null_cursor;
  1352. X***************
  1353. X*** 268,274 ****
  1354. X  {
  1355. X      if (x != fix_x || y != fix_y || num_point == 1) {
  1356. X          draw_latexline();
  1357. X!         latex_endpoint(fix_x, fix_y, x, y, &cur_x, &cur_y, latexarrow_mode, (magnet_mode)? 5: 1);
  1358. X          if (cur_cursor != &null_cursor) {
  1359. X          set_temp_cursor(&null_cursor);
  1360. X          cur_cursor = &null_cursor;
  1361. X--- 271,277 ----
  1362. X  {
  1363. X      if (x != fix_x || y != fix_y || num_point == 1) {
  1364. X          draw_latexline();
  1365. X!         latex_endpoint(fix_x, fix_y, x, y, &cur_x, &cur_y, latexarrow_mode, (magnet_mode)? (appres.INCHES? 5:(grid2_mode? 15:3)): 1);
  1366. X          if (cur_cursor != &null_cursor) {
  1367. X          set_temp_cursor(&null_cursor);
  1368. X          cur_cursor = &null_cursor;
  1369. X***************
  1370. X*** 355,360 ****
  1371. X--- 358,364 ----
  1372. X      if (!dot)
  1373. X          {
  1374. X          line->thickness = 1;
  1375. X+         line->style = RUBBER_LINE;
  1376. X          line->area_fill = 0;
  1377. X          draw_line(line,INV_PAINT);    /* erase temporary outline */
  1378. X          line->thickness = line_thickness;
  1379. X***************
  1380. X*** 361,367 ****
  1381. X          line->area_fill = fill_mode? cur_areafill : 0;
  1382. X          line->thickness = line_thickness;
  1383. X          line->style = line_style;
  1384. X!         line->style_val = cur_styleval;
  1385. X          draw_line(line,PAINT);        /* draw final */
  1386. X          }
  1387. X      clean_up();
  1388. X--- 365,371 ----
  1389. X          line->area_fill = fill_mode? cur_areafill : 0;
  1390. X          line->thickness = line_thickness;
  1391. X          line->style = line_style;
  1392. X!         line->style_val = cur_styleval*(line_thickness+1)/2;
  1393. X          draw_line(line,PAINT);        /* draw final */
  1394. X          }
  1395. X      clean_up();
  1396. X***************
  1397. X*** 399,405 ****
  1398. X--- 403,412 ----
  1399. X      XPoint *points;
  1400. X      GC gc;
  1401. X  
  1402. X+ /*
  1403. X      if (line->area_fill <= 0 || line->type == T_POLYLINE)
  1404. X+ */
  1405. X+     if (line->area_fill <= 0)
  1406. X          return;
  1407. X  
  1408. X      if (op == PAINT)        /* fill */
  1409. X***************
  1410. X*** 426,432 ****
  1411. X          points[i].x = pnt->x;
  1412. X          points[i].y = pnt->y;
  1413. X          }
  1414. X!     XFillPolygon(tool_d,canvas_win,gc,points, npts,
  1415. X              Complex, CoordModeOrigin);
  1416. X      free(points);
  1417. X      }
  1418. X--- 433,439 ----
  1419. X          points[i].x = pnt->x;
  1420. X          points[i].y = pnt->y;
  1421. X          }
  1422. X!     zXFillPolygon(tool_d,canvas_win,gc,points, npts,
  1423. X              Complex, CoordModeOrigin);
  1424. X      free(points);
  1425. X      }
  1426. X***************
  1427. X*** 459,485 ****
  1428. X      
  1429. X      diam = 2*radius;
  1430. X      /* upper left */
  1431. X!     XFillArc(tool_d, canvas_win, gc, xmin, ymin,
  1432. X              diam, diam, 90*64, 90*64);
  1433. X      /* lower left */
  1434. X!     XFillArc(tool_d, canvas_win, gc, xmin, ymax-diam,
  1435. X              diam, diam, 180*64, 90*64);
  1436. X      /* lower right */
  1437. X!     XFillArc(tool_d, canvas_win, gc, xmax-diam, ymax-diam,
  1438. X              diam, diam, 270*64, 90*64);
  1439. X      /* upper right */
  1440. X!     XFillArc(tool_d, canvas_win, gc, xmax-diam, ymin,
  1441. X              diam, diam, 0*64, 90*64);
  1442. X      /* fill strip on left side between upper and lower arcs */
  1443. X      if (ymax-ymin-diam > 0)
  1444. X!         XFillRectangle(tool_d, canvas_win, gc, xmin, ymin+radius,
  1445. X              radius, ymax-ymin-diam);
  1446. X      /* fill middle section */
  1447. X      if (xmax-xmin-diam > 0)
  1448. X!         XFillRectangle(tool_d, canvas_win, gc, xmin+radius, ymin,
  1449. X              xmax-xmin-diam, ymax-ymin);
  1450. X      /* fill strip on right side between upper and lower arcs */
  1451. X      if (ymax-ymin-diam > 0)
  1452. X!         XFillRectangle(tool_d, canvas_win, gc, xmax-radius, ymin+radius,
  1453. X              radius, ymax-ymin-diam);
  1454. X      }
  1455. X--- 466,492 ----
  1456. X      
  1457. X      diam = 2*radius;
  1458. X      /* upper left */
  1459. X!     zXFillArc(tool_d, canvas_win, gc, xmin, ymin,
  1460. X              diam, diam, 90*64, 90*64);
  1461. X      /* lower left */
  1462. X!     zXFillArc(tool_d, canvas_win, gc, xmin, ymax-diam,
  1463. X              diam, diam, 180*64, 90*64);
  1464. X      /* lower right */
  1465. X!     zXFillArc(tool_d, canvas_win, gc, xmax-diam, ymax-diam,
  1466. X              diam, diam, 270*64, 90*64);
  1467. X      /* upper right */
  1468. X!     zXFillArc(tool_d, canvas_win, gc, xmax-diam, ymin,
  1469. X              diam, diam, 0*64, 90*64);
  1470. X      /* fill strip on left side between upper and lower arcs */
  1471. X      if (ymax-ymin-diam > 0)
  1472. X!         zXFillRectangle(tool_d, canvas_win, gc, xmin, ymin+radius,
  1473. X              radius, ymax-ymin-diam);
  1474. X      /* fill middle section */
  1475. X      if (xmax-xmin-diam > 0)
  1476. X!         zXFillRectangle(tool_d, canvas_win, gc, xmin+radius, ymin,
  1477. X              xmax-xmin-diam, ymax-ymin);
  1478. X      /* fill strip on right side between upper and lower arcs */
  1479. X      if (ymax-ymin-diam > 0)
  1480. X!         zXFillRectangle(tool_d, canvas_win, gc, xmax-radius, ymin+radius,
  1481. X              radius, ymax-ymin-diam);
  1482. X      }
  1483. X*** @xfig.pl9/main.c    Thu Sep 20 16:21:20 1990
  1484. X--- ./main.c    Mon Jun  3 11:14:17 1991
  1485. X***************
  1486. X*** 1,3 ****
  1487. X--- 1,4 ----
  1488. X+ /* changes by ges to introduce startFontSize */
  1489. X  /* 
  1490. X   *    FIG : Facility for Interactive Generation of figures
  1491. X   *
  1492. X***************
  1493. X*** 66,71 ****
  1494. X--- 67,74 ----
  1495. X          XtOffset(appresPtr, boldFont), XtRString, (caddr_t)NULL},
  1496. X      {"normalFont", "NormalFont", XtRString, sizeof(char *),
  1497. X          XtOffset(appresPtr, normalFont), XtRString, (caddr_t)NULL},
  1498. X+     {"startfontsize", "StartFontSize", XtRFloat, sizeof(float),
  1499. X+         XtOffset(appresPtr, startfontsize), XtRInt, (caddr_t)&zero},
  1500. X  };
  1501. X  
  1502. X  static XrmOptionDescRec options[] =
  1503. X***************
  1504. X*** 88,93 ****
  1505. X--- 91,98 ----
  1506. X       {"-metric", ".inches", XrmoptionNoArg, "False"},
  1507. X      {"-boldFont", ".boldFont", XrmoptionSepArg, 0},
  1508. X      {"-normalFont", ".normalFont", XrmoptionSepArg, 0},
  1509. X+     {"-startFontSize", ".startfontsize", XrmoptionSepArg, 0},
  1510. X+     {"-startfontsize", ".startfontsize", XrmoptionSepArg, 0},
  1511. X  };
  1512. X  
  1513. X  static XtCallbackRec    callbacks[] =
  1514. X***************
  1515. X*** 122,135 ****
  1516. X      sprintf(tstr,"%d",PATCHLEVEL);
  1517. X      strcat(tool_name, tstr);
  1518. X      strcat(file_header, PROTOCOL_VERSION);
  1519. X-     printf("Initializing FIG v%s Protocol v%s (X11 patchlevel %d) ... \n", 
  1520. X-             FIG_VERSION, PROTOCOL_VERSION, PATCHLEVEL);
  1521. X      tool = XtInitialize("fig", "Fig", options, XtNumber(options),
  1522. X          (Cardinal *)&argc, argv);
  1523. X  
  1524. X      fix_converters();
  1525. X      XtGetApplicationResources(tool, &appres, application_resources, 
  1526. X!             10, NULL, 0 );
  1527. X      
  1528. X      i=1;
  1529. X      while (argc-- > 1)
  1530. X--- 127,138 ----
  1531. X      sprintf(tstr,"%d",PATCHLEVEL);
  1532. X      strcat(tool_name, tstr);
  1533. X      strcat(file_header, PROTOCOL_VERSION);
  1534. X      tool = XtInitialize("fig", "Fig", options, XtNumber(options),
  1535. X          (Cardinal *)&argc, argv);
  1536. X  
  1537. X      fix_converters();
  1538. X      XtGetApplicationResources(tool, &appres, application_resources, 
  1539. X!             XtNumber(application_resources), NULL, 0 );
  1540. X      
  1541. X      i=1;
  1542. X      while (argc-- > 1)
  1543. X***************
  1544. X*** 199,204 ****
  1545. X--- 202,209 ----
  1546. X      form = XtCreateManagedWidget("form", formWidgetClass, tool,
  1547. X          form_args, XtNumber(form_args));
  1548. X      
  1549. X+     if (size_button == 0)
  1550. X+         size_button = (int) appres.startfontsize;
  1551. X      if (size_button == 0)
  1552. X          size_button = DEF_PRINTFONTSIZE;
  1553. X  
  1554. X*** @xfig.pl9/move.c    Mon Apr 30 12:13:29 1990
  1555. X--- ./move.c    Mon Jun  3 11:14:22 1991
  1556. X***************
  1557. X*** 13,20 ****
  1558. X  #include "func.h"
  1559. X  #include "object.h"
  1560. X  #include "paintop.h"
  1561. X  
  1562. X- #define            TOLERANCE    3
  1563. X  
  1564. X  extern            (*canvas_kbd_proc)();
  1565. X  extern            (*canvas_locmove_proc)();
  1566. X--- 13,20 ----
  1567. X  #include "func.h"
  1568. X  #include "object.h"
  1569. X  #include "paintop.h"
  1570. X+ #include "zoom.h"
  1571. X  
  1572. X  
  1573. X  extern            (*canvas_kbd_proc)();
  1574. X  extern            (*canvas_locmove_proc)();
  1575. X***************
  1576. X*** 25,37 ****
  1577. X  extern            null_proc();
  1578. X  extern            set_popupmenu();
  1579. X  
  1580. X- extern F_line        *line_search();
  1581. X- extern F_arc        *arc_search();
  1582. X- extern F_ellipse    *ellipse_search();
  1583. X- extern F_text        *text_search();
  1584. X- extern F_spline        *spline_search();
  1585. X- extern F_compound    *compound_search();
  1586. X- 
  1587. X  extern int        foreground_color, background_color;
  1588. X  extern int        pointmarker_shown, compoundbox_shown;
  1589. X  extern int        last_object;
  1590. X--- 25,30 ----
  1591. X***************
  1592. X*** 38,49 ****
  1593. X  extern int        last_action;
  1594. X  
  1595. X  extern int        init_move();
  1596. X  
  1597. X  move_selected()
  1598. X  {
  1599. X      canvas_kbd_proc = null_proc;
  1600. X      canvas_locmove_proc = null_proc;
  1601. X!     canvas_leftbut_proc = init_move;
  1602. X      canvas_middlebut_proc = null_proc;
  1603. X      canvas_rightbut_proc = set_popupmenu;
  1604. X      return_proc = move_selected;
  1605. X--- 31,44 ----
  1606. X  extern int        last_action;
  1607. X  
  1608. X  extern int        init_move();
  1609. X+ extern int        object_search();
  1610. X  
  1611. X  move_selected()
  1612. X  {
  1613. X      canvas_kbd_proc = null_proc;
  1614. X      canvas_locmove_proc = null_proc;
  1615. X!     init_object_search(init_move);
  1616. X!     canvas_leftbut_proc = object_search /*init_move*/;
  1617. X      canvas_middlebut_proc = null_proc;
  1618. X      canvas_rightbut_proc = set_popupmenu;
  1619. X      return_proc = move_selected;
  1620. X***************
  1621. X*** 51,58 ****
  1622. X      reset_action_on();
  1623. X      }
  1624. X  
  1625. X! init_move(x, y)
  1626. X! int    x, y;
  1627. X  {
  1628. X      F_line        *l;
  1629. X      F_arc        *a;
  1630. X--- 46,55 ----
  1631. X      reset_action_on();
  1632. X      }
  1633. X  
  1634. X! init_move(p,type,x,y,px,py)
  1635. X! char *p;
  1636. X! int type;
  1637. X! int px,py;
  1638. X  {
  1639. X      F_line        *l;
  1640. X      F_arc        *a;
  1641. X***************
  1642. X*** 60,69 ****
  1643. X      F_text        *t;
  1644. X      F_spline    *s;
  1645. X      F_compound    *c;
  1646. X-     int        px, py;
  1647. X      PR_SIZE        size;
  1648. X  
  1649. X!     if ((c = compound_search(x, y, TOLERANCE, &px, &py)) != NULL) {
  1650. X          set_temp_cursor(&wait_cursor);
  1651. X          win_setmouseposition(canvas_win, px, py);
  1652. X          if (compoundbox_shown) draw_compoundbox(c, INV_PAINT);
  1653. X--- 57,67 ----
  1654. X      F_text        *t;
  1655. X      F_spline    *s;
  1656. X      F_compound    *c;
  1657. X      PR_SIZE        size;
  1658. X  
  1659. X!     switch(type)
  1660. X!     { case O_COMPOUND:
  1661. X!         c=(F_compound *) p;
  1662. X          set_temp_cursor(&wait_cursor);
  1663. X          win_setmouseposition(canvas_win, px, py);
  1664. X          if (compoundbox_shown) draw_compoundbox(c, INV_PAINT);
  1665. X***************
  1666. X*** 73,80 ****
  1667. X          clean_up();
  1668. X          set_action_object(F_MOVE, O_COMPOUND);
  1669. X          set_latestcompound(c);
  1670. X!         }
  1671. X!     else if ((l = line_search(x, y, TOLERANCE, &px, &py)) != NULL) {
  1672. X          set_temp_cursor(&wait_cursor);
  1673. X          erase_pointmarker();
  1674. X          win_setmouseposition(canvas_win, px, py);
  1675. X--- 71,79 ----
  1676. X          clean_up();
  1677. X          set_action_object(F_MOVE, O_COMPOUND);
  1678. X          set_latestcompound(c);
  1679. X!         break;
  1680. X!       case O_POLYLINE:
  1681. X!         l=(F_line *) p;
  1682. X          set_temp_cursor(&wait_cursor);
  1683. X          erase_pointmarker();
  1684. X          win_setmouseposition(canvas_win, px, py);
  1685. X***************
  1686. X*** 84,91 ****
  1687. X          clean_up();
  1688. X          set_action_object(F_MOVE, O_POLYLINE);
  1689. X          set_latestline(l);
  1690. X!         }
  1691. X!     else if ((t = text_search(x, y)) != NULL) {
  1692. X          set_temp_cursor(&wait_cursor);
  1693. X          erase_pointmarker();
  1694. X          px = 0;
  1695. X--- 83,91 ----
  1696. X          clean_up();
  1697. X          set_action_object(F_MOVE, O_POLYLINE);
  1698. X          set_latestline(l);
  1699. X!         break;
  1700. X!       case O_TEXT:
  1701. X!         t=(F_text *) p;
  1702. X          set_temp_cursor(&wait_cursor);
  1703. X          erase_pointmarker();
  1704. X          px = 0;
  1705. X***************
  1706. X*** 93,103 ****
  1707. X          {
  1708. X          size = pf_textwidth(t->font, t->size, strlen(t->cstring), t->cstring);
  1709. X          if (t->type == T_CENTER_JUSTIFIED)
  1710. X!             px = size.x/2;
  1711. X          else
  1712. X!             px = size.x;
  1713. X          }
  1714. X!         pw_text(canvas_win, t->base_x - px, t->base_y, INV_PAINT, 
  1715. X              t->font, t->size, t->cstring);
  1716. X          init_textdragging(t, x, y);
  1717. X          set_temp_cursor(&null_cursor);
  1718. X--- 93,103 ----
  1719. X          {
  1720. X          size = pf_textwidth(t->font, t->size, strlen(t->cstring), t->cstring);
  1721. X          if (t->type == T_CENTER_JUSTIFIED)
  1722. X!             px = size.x/2/zoomscale;
  1723. X          else
  1724. X!             px = size.x/zoomscale;
  1725. X          }
  1726. X!         pw_text(canvas_win, t->base_x - px, t->base_y, ERASE, 
  1727. X              t->font, t->size, t->cstring);
  1728. X          init_textdragging(t, x, y);
  1729. X          set_temp_cursor(&null_cursor);
  1730. X***************
  1731. X*** 104,111 ****
  1732. X          clean_up();
  1733. X          set_action_object(F_MOVE, O_TEXT);
  1734. X          set_latesttext(t);
  1735. X!         }
  1736. X!     else if ((e = ellipse_search(x, y, TOLERANCE, &px, &py)) != NULL) {
  1737. X          set_temp_cursor(&wait_cursor);
  1738. X          erase_pointmarker();
  1739. X          set_temp_cursor(&null_cursor);
  1740. X--- 104,112 ----
  1741. X          clean_up();
  1742. X          set_action_object(F_MOVE, O_TEXT);
  1743. X          set_latesttext(t);
  1744. X!         break;
  1745. X!       case O_ELLIPSE:
  1746. X!         e=(F_ellipse *) p;
  1747. X          set_temp_cursor(&wait_cursor);
  1748. X          erase_pointmarker();
  1749. X          set_temp_cursor(&null_cursor);
  1750. X***************
  1751. X*** 116,123 ****
  1752. X          clean_up();
  1753. X          set_action_object(F_MOVE, O_ELLIPSE);
  1754. X          set_latestellipse(e);
  1755. X!         }
  1756. X!     else if ((a = arc_search(x, y, TOLERANCE, &px, &py)) != NULL) {
  1757. X          set_temp_cursor(&wait_cursor);
  1758. X          erase_pointmarker();
  1759. X          win_setmouseposition(canvas_win, px, py);
  1760. X--- 117,125 ----
  1761. X          clean_up();
  1762. X          set_action_object(F_MOVE, O_ELLIPSE);
  1763. X          set_latestellipse(e);
  1764. X!         break;
  1765. X!       case O_ARC:
  1766. X!         a=(F_arc *) p;
  1767. X          set_temp_cursor(&wait_cursor);
  1768. X          erase_pointmarker();
  1769. X          win_setmouseposition(canvas_win, px, py);
  1770. X***************
  1771. X*** 127,134 ****
  1772. X          clean_up();
  1773. X          set_action_object(F_MOVE, O_ARC);
  1774. X          set_latestarc(a);
  1775. X!         }
  1776. X!     else if ((s = spline_search(x, y, TOLERANCE, &px, &py)) != NULL) {
  1777. X          set_temp_cursor(&wait_cursor);
  1778. X          win_setmouseposition(canvas_win, px, py);
  1779. X          erase_pointmarker();
  1780. X--- 129,137 ----
  1781. X          clean_up();
  1782. X          set_action_object(F_MOVE, O_ARC);
  1783. X          set_latestarc(a);
  1784. X!         break;
  1785. X!       case O_SPLINE:
  1786. X!         s= (F_spline *) p;
  1787. X          set_temp_cursor(&wait_cursor);
  1788. X          win_setmouseposition(canvas_win, px, py);
  1789. X          erase_pointmarker();
  1790. X***************
  1791. X*** 138,145 ****
  1792. X          clean_up();
  1793. X          set_action_object(F_MOVE, O_SPLINE);
  1794. X          set_latestspline(s);
  1795. X!         }
  1796. X!     else
  1797. X          return;
  1798. X-     canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  1799. X      }
  1800. X--- 141,149 ----
  1801. X          clean_up();
  1802. X          set_action_object(F_MOVE, O_SPLINE);
  1803. X          set_latestspline(s);
  1804. X!         break;
  1805. X!     default:
  1806. X          return;
  1807. X      }
  1808. X+     canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
  1809. X+     }
  1810. END_OF_FILE
  1811. if test 48592 -ne `wc -c <'patch10.2'`; then
  1812.     echo shar: \"'patch10.2'\" unpacked with wrong size!
  1813. fi
  1814. # end of 'patch10.2'
  1815. fi
  1816. echo shar: End of archive 1 \(of 4\).
  1817. cp /dev/null ark1isdone
  1818. MISSING=""
  1819. for I in 1 2 3 4 ; do
  1820.     if test ! -f ark${I}isdone ; then
  1821.     MISSING="${MISSING} ${I}"
  1822.     fi
  1823. done
  1824. if test "${MISSING}" = "" ; then
  1825.     echo You have unpacked all 4 archives.
  1826.     rm -f ark[1-9]isdone
  1827. else
  1828.     echo You still need to unpack the following archives:
  1829.     echo "        " ${MISSING}
  1830. fi
  1831. ##  End of shell archive.
  1832. exit 0
  1833.  
  1834. --
  1835. Dan Heller
  1836. O'Reilly && Associates       Z-Code Software    Comp-sources-x:
  1837. Senior Writer                President          comp-sources-x@uunet.uu.net
  1838. argv@ora.com                 argv@zipcode.com
  1839.